import Vue from 'vue';
import Router from 'vue-router';
import Home from '../views/home/index.vue';
import Process from '../views/process/index.vue';
Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      children: [
        {
          path: 'process',
          name: 'process',
          component: Process,
        },
        {
          path: 'instance',
          name: 'instance',
          component: () => import('@/views/instance/index.vue'),
        },
        {
          path: 'datasource',
          name: 'datasource',
          component: () => import('@/views/datasource/index.vue'),
        },
        {
          path: 'datatable',
          name: 'datatable',
          component: () => import('@/views/datatable/index.vue'),
        },
        {
          path: 'api',
          name: 'api',
          component: () => import('@/views/api/index.vue'),
        },
        {
          path: 'form',
          name: 'form',
          component: () => import('@/views/form/index.vue'),
        },
        {
          path: 'detail',
          name: 'detail',
          component: () => import('@/views/detail/index.vue'),
        },
      ],
      redirect: Process,
    },
    {
      path: '/designer',
      name: 'designer',
      component: () => import('@/views/designer/index.vue'),
    },
  ],
});
